x86/xsaves: calculate comp_offsets[] based on xcomp_bv
authorShuai Ruan <shuai.ruan@linux.intel.com>
Tue, 29 Mar 2016 15:15:57 +0000 (17:15 +0200)
committerJan Beulich <jbeulich@suse.com>
Tue, 29 Mar 2016 15:15:57 +0000 (17:15 +0200)
commit9979547be5875437abae58401093279113258b18
tree1360366ba710bb193de0abd2450df6f265c712fc
parent3130079f5140afa09093e51dc85b5d1246fab001
x86/xsaves: calculate comp_offsets[] based on xcomp_bv

Previous patch using all available features calculate comp_offsets.
This is wrong.This patch fix this bug by calculating the comp_offset
based on xcomp_bv of current guest.
Also, the comp_offset should take alignment into consideration.

Reported-by: Jan Beulich <jbeulich@suse.com>
Signed-off-by: Shuai Ruan <shuai.ruan@linux.intel.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
xen/arch/x86/xstate.c
xen/include/asm-x86/xstate.h